// store/index.js
import { defineStore } from 'pinia';

export const useMainStore = defineStore('main', {
    state: () => ({
        // 这里定义你的 state
        patientId: null,
        departAndClinic: null,
        registerInfo: null,
        examItemRecordDetails: null
    }),
    actions: {
        setPatientId(patientId){
          this.patientId = patientId;
        },
        // 预约挂号的信息传递
        setDepartAndClinic(departAndClinic) {
            this.departAndClinic = departAndClinic;
        },
        setRegisterInfo(registerInfo){
            this.registerInfo = registerInfo;
        },
        // 预约检查的信息传递
        setExamItemRecordDetails(examItemRecordDetails){
            this.examItemRecordDetails = examItemRecordDetails;
        }
    },
    getters: {
        getPatientId(){
            return this.patientId;
        },
        getDepartAndClinic() {
            return this.departAndClinic;
        },
        getRegisterInfo(){
            return this.registerInfo;
        },
        getExamItemRecordDetails(){
            return this.examItemRecordDetails;
        }
    }
});
